package com.yixq.soa.service.comm.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 登录类型枚举 policapp.user login_type_id
 *
 * @author yixq yixq@doordu.com
 * @version V1.0
 * @ClassName: LoginTypeIdEnum
 * @Description:
 * @date 2017年5月16日 上午10:55:56
 */
public enum OpenDoorType {

    CARD_OPEN(1, "门禁卡"),
    APP_OPEN(2, "APP"),
    CALL_OPEN(3, "拨号"),
    PASS_OPEN(4, "密码");

    private static Map<Integer, OpenDoorType> map = new HashMap<Integer, OpenDoorType>();

    static {
        for (OpenDoorType e : OpenDoorType.values()) {
            map.put(e.getTypeId(), e);
        }
    }

    private Integer typeId;
    private String name;

    OpenDoorType(Integer typeId, String name) {
        this.typeId = typeId;
        this.name = name;
    }

    public static OpenDoorType getName(Integer typeId) {
        return map.get(typeId);
    }

    public Integer getTypeId() {
        return typeId;
    }

    public String toString() {
        return this.name;
    }

    public String getName() {
        return this.name;
    }
}
